import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios'
import './assets/css/global.css'
import '@/plugins/element-ui'

axios.defaults.baseURL = 'http://vue-shop-api-t.itheima.net/api/private/v1'
Vue.prototype.$http = axios

Vue.config.productionTip = false

axios.interceptors.request.use(config => {
  config.headers.Authorization = window.sessionStorage.getItem('token')

  return config
})

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
